package com.billdowney.entity.system.log;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.billdowney.entity.base.BaseEntityIdByUUIDHex;
import com.billdowney.entity.user.UserInfo;
import com.billdowney.util.log.SystemLogHandleType;

import io.swagger.annotations.ApiModelProperty;

/**
 * 系统日志记录表
 * 
 * @author 超级小富翁 - BillDowney
 * @date 2019年4月29日 上午11:05:13
 */
@Entity
@Table(name = "system_log")
public class SystemLog extends BaseEntityIdByUUIDHex {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "日志描述")
	@Column(length = 500)
	private String logDesc;
	@ApiModelProperty(value = "操作类型")
	@Enumerated(EnumType.STRING)
	@Column(length = 20)
	private SystemLogHandleType handleType;
	@ApiModelProperty(value = "相关类")
	@Column(length = 100)
	private String aboutClass;

	@ManyToOne(targetEntity = UserInfo.class, cascade = { CascadeType.MERGE,
			CascadeType.REFRESH }, fetch = FetchType.EAGER)
	@JoinColumn(name = "userInfo_id")
	@ApiModelProperty(value = "用户信息", notes = "如果为空，则为系统日志")
	private UserInfo userInfo;

	public String getLogDesc() {
		return logDesc;
	}

	public void setLogDesc(String logDesc) {
		this.logDesc = logDesc;
	}

	public SystemLogHandleType getHandleType() {
		return handleType;
	}

	public void setHandleType(SystemLogHandleType handleType) {
		this.handleType = handleType;
	}

	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}

	public String getAboutClass() {
		return aboutClass;
	}

	public void setAboutClass(String aboutClass) {
		this.aboutClass = aboutClass;
	}

}
